<template>
  <Tab ref="tab" type="home" />
  <view class="container">
    <div class="content">
      <div class="title-container">
        <span>AI智能 #</span>
        <div>
          <div class="title">
            <span>预定最佳机票</span>
            <div class="horizon"></div>
          </div>
          <img src="../../static/img/target.png" alt="" />
        </div>
        <span>AI 与 你⽣活中，充满惊喜。</span>
      </div>

      <view class="btn" @click="jumpTo">
        <span>立即体验</span>
      </view>
    </div>
  </view>
</template>

<script setup>
import { uni } from "@dcloudio/uni-h5";
import { ref, reactive, onMounted } from "vue";
import mitter from "../../utils/mitter";
import { onLoad } from "@dcloudio/uni-app";
import typeStore from "../store/typeStore.js";
import {setToken} from '@/utils/auth'
let tab = ref(null);
let store = typeStore();


onMounted(() => {
  if (store.type == '1') {
    tab.value.queryOrder();
  }
})


function jumpTo() {
  let token=`eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJuYmYiOjE3MTI4MzkwNDcsImFjY2Vzc0tleSI6Ijk5YjcxOTVjMjg2OGY1MDRiMDJmZTA5MDRiNDc0NmM4IiwiZXhwIjoxNzEzNDQzODQ3LCJpYXQiOjE3MTI4MzkwNDd9.Adm69ofo4zUyu7c513UHP476e0_wryea5vkEJ16HShg`
  setToken(token)
  uni.navigateTo({
    url: "/pages/order/index",
  });
}
</script>

<style lang="scss">
.container {
  background-size: cover; /* 背景图覆盖整个元素 */
  background-position: center; /* 背景图居中 */
  height: 100dvh; /* 高度设置为100%，根据实际情况调整 */
  width: 100dvw; /* 宽度设置为100%，根据实际情况调整 */
  position: fixed; /* 定位为固定，使得背景图覆盖整个页面 */
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  // z-index: -1;  /* 确保背景在其他内容之下 */
  background-repeat: no-repeat; /* 背景图片不重复 */
  background-image: url("../../static/img/backgroud.png");

  .content {
    position: absolute;
    top: 756rpx;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 550rpx;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;

    .title-container {
      display: flex;
      flex-direction: column;
      align-items: center;
      & > :nth-child(1) {
        width: 342rpx;
        height: 88rpx;
        font-family: PingFangSC, PingFang SC;
        font-weight: 600;
        font-size: 88rpx;
        color: #ffffff;
        line-height: 88rpx;
        text-align: center;
        font-style: normal;
      }
      & > :nth-child(2) {
        margin-top: 10px;
        display: flex;
        align-items: flex-end;
        .title {
          span {
            width: 534rpx;
            height: 88rpx;
            font-family: PingFangSC, PingFang SC;
            font-weight: 600;
            font-size: 88rpx;
            color: #0effaf;
            line-height: 88rpx;
            text-align: left;
            font-style: normal;
            background: linear-gradient(
              0deg,
              #74e9f9 0%,
              #fff0e0 48%,
              #ff7acd 100%
            );
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
          }
          .horizon {
            width: 526rpx;
            border: 2rpx solid #ffffff;
            margin: 15px 0;
          }
        }
        img {
          width: 40rpx;
          height: 50rpx;
          position: relative;
          bottom: 55rpx;
          left: 5px;
        }
      }
      & > :nth-child(3) {
        width: 402rpx;
        height: 40rpx;
        font-family: PingFangSC, PingFang SC;
        font-weight: 400;
        font-size: 32rpx;
        color: #ffffff;
        line-height: 40rpx;
        text-align: center;
        font-style: normal;
      }
    }

    .btn {
      width: 440rpx;
      height: 100rpx;
      background: #ffffff;
      border-radius: 54rpx;
      display: flex;
      justify-content: center;
      align-items: center;
      margin-top: 120rpx;
      span {
        width: 144rpx;
        height: 36rpx;
        font-family: PingFangSC, PingFang SC;
        font-weight: 500;
        font-size: 36rpx;
        color: #000000;
        line-height: 36rpx;
        text-align: center;
        font-style: normal;
      }
      &:active {
        background: #005ff9;
        span {
          color: #ffffff;
        }
      }
    }
  }
}
</style>
